<template>
  <el-menu
    :default-openeds="opens"
    style="min-height: 100%; overflow-x: hidden"
    background-color="rgb(48, 65, 86)"
    text-color="#fff"
    active-text-color="#ffd04b"
    :collapse-transition="false"
    :collapse="isCollapse"
    router
  >
    <div style="height: 60px; line-height: 60px; text-align: center">
      <img
        src="../assets/logo.png"
        alt=""
        style="width: 20px; position: relative; top: 5px"
      />
      <b style="color: white; margin-left: 5px" v-show="logoTextShow"
        >社团管理系统</b
      >
    </div>
    
    <el-menu-item index="/simple/home">
      <i :class="el-icon-house"> </i>
      <span slot="title">{{ '主页' }}</span>
    </el-menu-item>
    <el-menu-item index="/simple/all">
      <i :class="el-icon-s-marketing"> </i>
      <span slot="title">{{ '学校社团' }}</span>
    </el-menu-item>
    <el-menu-item index="/simple/create">
      <i :class="el-icon-s-marketing"> </i>
      <span slot="title">{{ '成立社团' }}</span>
    </el-menu-item>
     <el-menu-item index="/simple/mycampus">
      <i :class="el-icon-s-marketing"> </i>
      <span slot="title">{{ '我的社团' }}</span>
    </el-menu-item>
    <el-menu-item index="/simple/myappliforjc">
      <i :class="el-icon-s-marketing"> </i>
      <span slot="title">{{ '加入社团申请' }}</span>
    </el-menu-item>
    <el-menu-item index="/simple/myappliforcreatecam">
      <i :class="el-icon-s-marketing"> </i>
      <span slot="title">{{ '成立社团申请' }}</span>
    </el-menu-item>
    
  </el-menu>
  
</template>

<script>
export default {
  name: "Aside",
  props: {
    isCollapse: Boolean,
    logoTextShow: Boolean,
  },
  data() {
    return {
      menus: localStorage.getItem("menus")
        ? JSON.parse(localStorage.getItem("menus"))
        : [],
      opens: localStorage.getItem("menus")
        ? JSON.parse(localStorage.getItem("menus")).map((v) => v.id + "")
        : [],
    };
  },
};
</script>

<style>
.el-menu-item.is-active {
  background-color: rgb(38, 52, 69) !important;
}
.el-menu-item:hover {
  background-color: rgb(38, 52, 69) !important;
}

.el-submenu__title:hover {
  background-color: rgb(38, 52, 69) !important;
}
/*解决收缩菜单文字不消失问题*/
.el-menu--collapse span {
  visibility: hidden;
}
</style>
